<?php

include_once ('utilities.php');

$id = $_GET['id'];
$sql = "SELECT FileData, FileType FROM Uploads WHERE FileID='" . $id . "'";
$result = $mysqli->query($sql);
$row = $result->fetch_array(MYSQLI_ASSOC);

header("Content-Type: image/" . $row['FileType']);
echo $row['FileData'];

?>